package tt.dz.egobus.servicemanager.service;

import tt.dz.egobus.servicemanager.base.service.ExtendBaseService;
import tt.dz.egobus.servicemanager.business.point.AddressPoint;
import tt.dz.egobus.servicemanager.business.point.BusPoint;
import tt.dz.egobus.servicemanager.entities.BusinessService;
import tt.dz.egobus.servicemanager.entities.BusinessServiceInfo;
import tt.dz.egobus.servicemanager.entities.DriverRegisterBusRelative;
import tt.dz.egobus.servicemanager.vo.BusinessFinishVo;
import tt.dz.egobus.servicemanager.vo.BusinessRequestVo;

/**
 * @author Anson
 * @date 17-3-15
 * @name 业务服务层
 * @since 1.0.3
 */
public interface BusinessServiceService extends ExtendBaseService<BusinessService, String> {


    /**
     * @param relative          司机绑定的车辆关系表
     * @param businessId        业务流水号
     * @param userId            请求用户的Id
     * @param busPoint          当前坐标
     * @param businessRequestVo
     * @author Anson
     * @date 17-3-28
     * @name 及时包车开始业务派送
     * @since 1.0.3
     */
    boolean doSaveBeginBusiness(DriverRegisterBusRelative relative, String businessId, String userId, BusPoint
            busPoint, BusinessRequestVo businessRequestVo);

    /**
     * @param businessId 业务流水号
     * @author Anson
     * @date 17-3-28
     * @name 根据流水号获取业务信息，当前的信息要么一个要么null
     * @since 1.0.3
     */
    BusinessService getBusinessByBusinessId(String businessId);

    /**
     * @param businessId
     * @author Anson
     * @date 17-3-28
     * @name 校验当前业务流水号是否正常
     * @since 1.0.3
     */
    boolean validateBusinessId(String businessId);

    /**
     * @param businessId
     * @param addressPoint
     * @author Anson
     * @date 17-3-28
     * @name 处理当前业务为doBusiness的状态
     * @since 1.0.3
     */
    boolean doSaveBusiness(String businessId, AddressPoint addressPoint);

    /**
     * @param businessService 业务流水号
     * @param vo              完成时候vo
     * @author Anson
     * @date 17-3-29
     * @name
     * @since 1.0.3
     */
    boolean doSaveFinish(BusinessService businessService, BusinessFinishVo vo);

    /**
     * @param businessService 业务详细
     * @author Anson
     * @date 17-3-29
     * @name 用户取消
     * @since 1.0.3
     */
    boolean doSaveUserCancel(BusinessService businessService);

    /**
     * @param businessService 当前业务信息
     * @param orderId         当前订单id
     * @param status          当前订单状态
     * @author Anson
     * @date 17-3-30
     * @name 修改业务流水号的订单状态
     * @since 1.0.3
     */
    boolean modifyBusinessOrderStatus(BusinessService businessService, String orderId, int status, Double orderMoney);

    /**
     * @param userId 用户id
     * @author Anson
     * @date 17-4-1
     * @name 判断某个用户是否含有未完成的业务流程
     * @since 1.0.3
     */
    boolean isExitUserUnDoneBusiness(String userId);

    /**
     * @param userId 用户id
     * @param
     * @author Anson
     * @date 17-4-1
     * @name 获取用户未完成的流程信息
     * @since 1.0.3
     */
    BusinessService getUserUnDoneService(String userId);

    /*
     *
     * @param driverId 司机id
     * @author Anson
     * @date 17-4-1
     * @name 司机当前未完成流程信息
     * @since 1.0.3
     *
     */
    BusinessService getDriverUnDoneService(String driverId);

    /**
     * @param orderId 订单id
     * @author Anson
     * @date 17-4-1
     * @name 根据订单信息查询流水号
     * @since 1.0.3
     */
    BusinessService getBusinessByOrderId(String orderId);

    /**
     * @param driverId 司机id
     * @author Anson
     * @date 17-4-11
     * @name 司机有效派单总数
     * @since 1.0.4
     */
    Integer getDriverBusinesCount(String driverId);

    /**
     * @param businessCodes 业务码数组
     * @param driverId      司机id
     * @author Anson
     * @date 17-4-12
     * @name 计算司机的在不同的业务服务下的服务次数
     * 返回结果中与请求中业务码一一对应
     * @since 1.0.4
     */
    Integer[] queryDriverBusinessCodeCount(Integer[] businessCodes, String driverId);

    /**
     * @param relative
     * @param relative
     * @param businessId
     * @param driverId
     * @param busPoint
     * @param businessRequestVo
     * @author Anson
     * @date 17-8-30
     * @name 司机生成一条预约信息
     * @since 1.0.7
     */
    boolean doBespeakBusiness(DriverRegisterBusRelative relative, String businessId, String driverId, BusPoint
            busPoint, BusinessRequestVo businessRequestVo);

    /**
     * @param businessService
     * @param relative
     * @author Anson
     * @date 17-8-30
     * @name 预约开始工作, 开始向请求人预约的地址出发
     * @since 1.0.7
     */
    boolean bespeakToBusiness(BusinessService businessService, DriverRegisterBusRelative relative);

    /**
     * @param businessService
     * @param businessServiceInfo
     * @author Anson
     * @date 17-8-30
     * @name 用户取消预约
     * @since 1.0.7
     */
    boolean bespeakCancel(BusinessService businessService, BusinessServiceInfo businessServiceInfo);

    /**
     * @param businessService
     * @author Anson
     * @date 17-8-31
     * @name 司机取消行程
     * @since 1.0.7
     */
    boolean driverCancelBusiness(BusinessService businessService);
}
